package com.hc.acoustics.widget.banner;

import androidx.annotation.DrawableRes;
import androidx.annotation.IntDef;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * 轮播图实体类
 */
public class YcBannerBeanNew {
    @IntDef({ImgType.LOCATION, ImgType.NET, ImgType.RES})
    @Retention(RetentionPolicy.SOURCE)
    public @interface ImgType {
        int LOCATION = 0;//手机本地
        int NET = 1;//网络图片
        int RES = 2;//资源
    }

    private String imgUrl;
    private String imgPath;
    @DrawableRes
    private int resId;
    @ImgType
    private int imgType;
    private boolean isLoadedImg = false;

    private YcBannerBeanNew() {

    }

    public static YcBannerBeanNew newLocation(String imgPath) {
        YcBannerBeanNew ycBannerBeanNew = new YcBannerBeanNew();
        ycBannerBeanNew.imgPath = imgPath;
        ycBannerBeanNew.imgType = ImgType.LOCATION;
        return ycBannerBeanNew;
    }

    public static YcBannerBeanNew newNet(String imgUrl) {
        YcBannerBeanNew ycBannerBeanNew = new YcBannerBeanNew();
        ycBannerBeanNew.imgUrl = imgUrl;
        ycBannerBeanNew.imgType = ImgType.NET;
        return ycBannerBeanNew;
    }

    public static YcBannerBeanNew newRes(@DrawableRes int resId) {
        YcBannerBeanNew ycBannerBeanNew = new YcBannerBeanNew();
        ycBannerBeanNew.resId = resId;
        ycBannerBeanNew.imgType = ImgType.RES;
        return ycBannerBeanNew;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public String getImgPath() {
        return imgPath;
    }

    public void setImgPath(String imgPath) {
        this.imgPath = imgPath;
    }

    public int getResId() {
        return resId;
    }

    public void setResId(int resId) {
        this.resId = resId;
    }

    @ImgType
    public int getImgType() {
        return imgType;
    }

    public void setImgType(int imgType) {
        this.imgType = imgType;
    }

    public boolean isLoadedImg() {
        return isLoadedImg;
    }

    public void setLoadedImg(boolean loadedImg) {
        isLoadedImg = loadedImg;
    }
}
